package com.xuxin.pda.presenter;

import com.xuxin.pda.bean.BaseBean;
import com.xuxin.pda.bean.TrashEnterBean;
import com.xuxin.pda.contract.TrashEnterContract;
import com.xuxin.pda.model.TrashEnterModel;

/**
 * Created by xu_xin
 * Created on 2021/2/7 0007
 */
public class TrashEnterPresenter implements TrashEnterContract.Presenter {
    private final TrashEnterModel model;
    private final TrashEnterContract.View view;

    public TrashEnterPresenter(TrashEnterContract.View view) {
        this.view = view;
        model = new TrashEnterModel();
    }

    @Override
    public void trashEnter(String WarehouseId, String InWarehouseTime, String UserId, String BoxIds) {
        if (null != model) {
            model.trashEnter(this, WarehouseId, InWarehouseTime, UserId, BoxIds);
        }
    }

    @Override
    public void onSuccess(TrashEnterBean trashEnterBean) {
        if (null != view) {
            view.onSuccess(trashEnterBean);
        }
    }

    /**
     * 以下内容复用
     */
    @Override
    public void onError(BaseBean baseBean) {
        if (null != view) {
            view.onError(baseBean);
        }
    }

    @Override
    public void onComplete() {
        if (null != view) {
            view.onComplete();
        }
    }
}